package org.third.spring.boot.hello.repository;

import java.util.Collection;
import java.util.List;
import java.util.Optional;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;
import org.third.spring.boot.hello.domain.HelloFeature;
import org.third.spring.boot.hello.domain.HelloUser;

@Repository
public interface HelloFeatureRepository extends CrudRepository<HelloFeature, Long> {

	Optional<HelloFeature> findById(Long uuid);

	//
	HelloFeature findByIdGreaterThan(Long id);

	HelloFeature findByIdGreaterThanEqual(Long id);

	HelloUser findByIdIn(Collection<Long> userIdList);

	List<HelloFeature> findByIdNotIn(Collection<Long> userIdList);

	@Query("select u from HelloFeature u where u.userId like %?1")
	List<HelloFeature> findByFirstnameEndsWith(String firstname);

	@Query("select u from HelloFeature u where u.userId = ?1")
	HelloFeature findByEmailAddress(String emailAddress);
}
